Shape Variables and Shape Spaces

Antigoni Kaliontzopoulou, CIBIO/InBIO, University of Porto

15 October, 2019

From GPA to Shape Data

Shape Spaces from GPA

\[\tiny{D}_{Proc}=\sqrt{\sum_{i,j}^{k,p}\left(\mathbf{Y}_{1.ij}-\mathbf{Y}_{2.ij}\right)^2}\]

Shape Spaces from GPA

\[\tiny{D}_{Proc}=\sqrt{\sum_{i,j}^{k,p}\left(\mathbf{Y}_{1.ij}-\mathbf{Y}_{2.ij}\right)^2}\]

Example with 2,000 random (uniform) triangles. Note overabundance of shapes near ā€˜north pole’.

Consequences of GPA

Consequences of GPA

Kendall’s Tangent Space Coordinates

\[\small\mathbf{X}'=\mathbf{X\left(I_{kp}-X_c^T(X_cX_c^T)^{-1}X_c\right)}\]

Kendall’s Tangent Space Coordinates

Same set of 2,000 randomly generated triangles

Shape Differences as Deformations

Shape Deformations: the Thin-Plate Spline

The Thin-Plate Spline

The Thin-Plate Spline

General TPS Model for \(\small{1}\) landmark: \[\tiny\begin{bmatrix} x^1\\y^1\end{bmatrix}=A\begin{bmatrix}1\\x\\y\end{bmatrix}+\sum_{i=1}^pw_iU(r_i)\]

where \(\tiny{A}\begin{bmatrix}1\\x\\y\end{bmatrix}\) represents the affine (uniform) component and \(\small\sum_{i=1}^pw_iU(r_i)\) represents to non-affine (non-uniform) component

TPS Computations

where: \(\tiny\mathbf{Q}= \begin{bmatrix} 1 & x_1 & y_1 \\ 1 & x_2 & y_2 \\ \vdots & \vdots & \vdots \\ 1 & x_p & y_p \end{bmatrix}\) & \(\tiny\mathbf{0}= \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\)

\(\tiny\mathbf{P}=\tiny\begin{bmatrix} 0 & U(r_{12}) & U(r_{12}) & \dots & U(r_{1p}) \\ U(r_{21}) & 0 & U(r_{23}) & \dots & U(r_{2p}) \\ U(r_{31}) & U(r_{32}) & 0 & \dots & U(r_{3p}) \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ U(r_{p1}) & U(r_{p2}) & U(r_{p3}) & \dots & 0 \end{bmatrix}\)

TPS Computations

where: \(\tiny\mathbf{Q}= \begin{bmatrix} 1 & x_1 & y_1 \\ 1 & x_2 & y_2 \\ \vdots & \vdots & \vdots \\ 1 & x_p & y_p \end{bmatrix}\) & \(\tiny\mathbf{0}= \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}\)

\(\tiny\mathbf{P}=\tiny\begin{bmatrix} 0 & U(r_{12}) & U(r_{12}) & \dots & U(r_{1p}) \\ U(r_{21}) & 0 & U(r_{23}) & \dots & U(r_{2p}) \\ U(r_{31}) & U(r_{32}) & 0 & \dots & U(r_{3p}) \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ U(r_{p1}) & U(r_{p2}) & U(r_{p3}) & \dots & 0 \end{bmatrix}\)

Here, \(\small\mathbf{Q}\) contains the coordinates of the reference and \(\small\mathbf{P}\) is found as: \(\small{U(r_{ij})}=r_{ij}^2ln(r_{ij})\) with \(\small{r_{ij}}\) as the distance between the \(\small{i^{th}}\) and \(\small{j^{th}}\) landmarks

NOTES: \(\small{0}\) is \(\small{4 \times 4}\) for 3D data. Also, for 3D data: \(\small{U(r_{ij})}=|{r_{ij}}|\)

TPS Computations (Cont.)

TPS Computations (Cont.)

\[\small\mathbf{L}_p^{-1}=\mathbf{E\Lambda{E}^T}\]

TPS Computations (Cont.)

\[\small\mathbf{L}_p^{-1}=\mathbf{E\Lambda{E}^T}\]

\[\small\mathbf{W}=\mathbf{V(I_2\otimes{E})=V}\begin{bmatrix}\mathbf{E} & \mathbf{0} \\ \mathbf{0} & \mathbf{E} \end{bmatrix})\]

where \(\small\mathbf{V}=\mathbf{[V_x|V_y]}\) with \(\small\mathbf{V_x}=\mathbf{(X-\overline{X}_{ref})}\) & \(\small\mathbf{V_y}=\mathbf{(Y-\overline{Y}_{ref})}\)

TPS Computations (Cont.)

\[\small\mathbf{L}_p^{-1}=\mathbf{E\Lambda{E}^T}\]

\[\small\mathbf{W}=\mathbf{V(I_2\otimes{E})=V}\begin{bmatrix}\mathbf{E} & \mathbf{0} \\ \mathbf{0} & \mathbf{E} \end{bmatrix})\]

where \(\small\mathbf{V}=\mathbf{[V_x|V_y]}\) with \(\small\mathbf{V_x}=\mathbf{(X-\overline{X}_{ref})}\) & \(\small\mathbf{V_y}=\mathbf{(Y-\overline{Y}_{ref})}\)
Note, one can weight partial warp scores inversely by spatial scale as: \(\small\mathbf{W}=\mathbf{V(I_2\otimes{E\Lambda^{-\alpha/2}})}\)

TPS Model: Uniform (Affine) Shape Estimation

\[\small\mathbf{S=U\oplus{B}}\]

TPS Model: Uniform (Affine) Shape Estimation

\[\small\mathbf{S=U\oplus{B}}\]

Rohlf and Bookstein. (2003). Syst. Biol.

Total Shape Variation

TPS Model: Example

\(\tiny\mathbf{X}_{sqr}=\begin{bmatrix} 0 & 0.5\\ -0.5 & 0\\ 0 & -0.5\\ 0.5 & 0 \end{bmatrix}\) and \(\tiny\mathbf{X}_{kite}=\begin{bmatrix} 0 & 0.375\\ -0.5 & 0.125\\ 0 & -0.625\\ 0.5 & 0.125 \end{bmatrix}\)

TPS Model: Example (Cont.)

TPS Model: Example (Cont.)

\(\tiny\mathbf{L_p^{-1}}=\left[ \begin{array} 0.7271 & -0.7271 & 0.7271 & -0.7271 \\ -0.7271 & 0.7271 & -0.7271 & 0.7271 \\ 0.7271 & -0.7271 & 0.7271 & -0.7271 \\ -0.7271 & 0.7271 & -0.7271 & 0.7271 \\ \end{array} \right]=\)

Which Shape Variables to Use?

Which Shape Variables to Use?

Shape Variables: Conclusions

Exploring Shape Variation

Principal Components Analysis (PCA)

PCA: Conceptual Visualization

PCA: Conceptual Visualization

PCA: Standard Computations

Principal component analysis (PCA) is two things: (1) a singular-value decomposition (SVD) of a symmetric matrix and (2) projection of mean-centered or standardized data onto eigenvectors from SVD.

Using mean-centered data: \(\small\mathbf{Y}_c\) we calculate:

\[\small\hat{\mathbf{\Sigma}}=\frac{\mathbf{Y}^{T}_c\mathbf{Y}_c}{n-1}\]

We then decompose the covariance matrix via eigen-analysis (SVD):

\[\small\hat{\mathbf{\Sigma}}=\mathbf{U} \mathbf{\Lambda} \mathbf{U}^T\]

This step identifies a set of orthogonal axes describing directions of variation. These are the columns of \(\small\mathbf{U}\). Next we project the data onto these axes as:

\[\small\mathbf{P} = \mathbf{Y}_c\mathbf{U}\]

Here, \(\small\mathbf{P}\) represent the set of projection scores (principal component scores) on each of the PC axes. These are used in the subsequent plot.

Finally, the percent variation explained by any principal component (column of \(\mathbf{U}\)) is \[\frac{\lambda_i}{tr\mathbf{\Lambda}}\]

PCA: Alternative Computations

Note that one can alternatively perform singular-value decomposition (SVD) directly on \(\small\mathbf{Y}_c\):

\[\small{\mathbf{Y}_c}=\mathbf{V} \mathbf{D} \mathbf{U}^T\]

Here, \(\small\mathbf{D^2}\) expresses the percent-variation explained by each PC-axis, which are found as the right-singular vectors in \(\small\mathbf{U}\).

PC scores are found as:

\[\small\mathbf{P} = \mathbf{VD}\]

NOTE: eigenanalysis of the inner product \(\small\mathbf{Y}^{T}_c\mathbf{Y}_c\) yields \(\small\mathbf{U}\), while eigenanalysis of the outer product \(\small\mathbf{Y}_c\mathbf{Y}^{T}_c\) yields \(\small\mathbf{V}\)

PCA of Shape Data: Relative Warps

\[\small{\mathbf{W^*}}=\mathbf{V} \mathbf{D} \mathbf{U}^T\]

PCA of Shape Data: Relative Warps

\[\small{\mathbf{W^{*}}}=\mathbf{V} \mathbf{D} \mathbf{U}^T\]

RWA: Example

PCA of Podarcis data

RWA: Example (Cont.)

RWA: Thoughts

Visualizing Shape Differences

Visualizing Shape Differences

*TPS of Ref->Target is a vector in shape space, which can be extended in length

Visualizing Shape Differences: Example

Shape Variables: Conclusions